package com.candoo.oil.scan;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.content.Intent;
import android.widget.Toast;

import org.json.JSONObject;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.v("info","主界面创建");
    }

    public void webLogin(View view)
    {
        Intent intent = new Intent(this, OrderListActivity.class);
        startActivity(intent);
    }

    public void webClose(View view)
    {
        new Thread(){
            @Override
            public void run()
            {
                try
                {


                //把网络访问的代码放在这里
                JSONObject d=new JSONObject("{'id':112233}");

                JSONObject r=  httpClientClass.PostJson("http://sale.nihao99.com/AgentCenter/Test/Interface",d);
                    Log.e("json_flag",r.getString("flag"));
                    Log.e("json_msg",r.getString("msg"));


                }
                catch (Exception e)
                {}
                finally {

                }
            }
        }.start();

        //finish();

        Toast.makeText(getApplicationContext(), "默认Toast样式",
                Toast.LENGTH_SHORT).show();
    }
}
